<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>d2p-cropper-uploader | d2-crud-plus</title>
    <meta name="description" content="d2-crud-plus doc">
    <link rel="icon" href="/d2-crud-plus/icon-only.png">
  <link rel="manifest" href="/d2-crud-plus/manifest.json">
  <meta name="theme-color" content="#3eaf7c">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <link rel="apple-touch-icon" href="/d2-crud-plus/icons/apple-touch-icon-152x152.png">
  <link rel="mask-icon" href="/d2-crud-plus/icons/safari-pinned-tab.svg" color="#3eaf7c">
  <meta name="msapplication-TileImage" content="/icons/msapplication-icon-144x144.png">
  <meta name="msapplication-TileColor" content="#000000">
    
    <link rel="preload" href="/d2-crud-plus/assets/css/0.styles.601f84da.css" as="style"><link rel="preload" href="/d2-crud-plus/assets/js/app.db3b8ec2.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/2.38672536.js" as="script"><link rel="preload" href="/d2-crud-plus/assets/js/17.9457a8ba.js" as="script"><link rel="prefetch" href="/d2-crud-plus/assets/js/10.69f2dbbe.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/11.3f07efd3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/12.dc714246.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/13.c90176aa.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/14.f1c594e6.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/15.b78aa9be.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/16.453ce94d.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/18.5b7c1aba.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/19.f7d471a7.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/20.f3ff9bb4.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/21.682f1a55.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/22.2a7eef21.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/23.00366a89.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/24.18b63793.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/25.ea2bfbc8.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/26.c432b5d8.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/27.3b64a611.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/28.98f471e7.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/29.6ae40dd4.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/3.f836fcd3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/30.e03eaca3.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/31.75c4762e.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/32.950c7cb6.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/33.7271029f.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/34.22aa9fbe.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/35.84128cad.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/36.38248508.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/37.bad14f62.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/38.652ee74b.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/39.26766aa6.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/4.bd7427ec.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/40.c2b061c2.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/41.c169542b.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/42.b9a26a0b.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/43.ecc2cdd0.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/44.d64e8d61.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/45.4ebd7dd2.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/5.4a3f6be9.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/6.c2cc518f.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/7.ceb2417c.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/8.abca8e2a.js"><link rel="prefetch" href="/d2-crud-plus/assets/js/9.68c18515.js">
    <link rel="stylesheet" href="/d2-crud-plus/assets/css/0.styles.601f84da.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/d2-crud-plus/" class="home-link router-link-active"><!----> <span class="site-name">d2-crud-plus</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/d2-crud-plus/guide/" class="nav-link router-link-active">指南</a></div><div class="nav-item"><a href="http://qiniu.veryreader.com/D2CrudPlusExample/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <a href="https://github.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/d2-crud-plus/guide/" class="nav-link router-link-active">指南</a></div><div class="nav-item"><a href="http://qiniu.veryreader.com/D2CrudPlusExample/index.html" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <a href="https://github.com/greper/d2-crud-plus" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>指南</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/" class="sidebar-link">介绍</a></li><li><a href="/d2-crud-plus/guide/quickstart.html" class="sidebar-link">快速上手</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>进阶</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/mixins.html" class="sidebar-link">d2CrudPlus.crud</a></li><li><a href="/d2-crud-plus/guide/options.html" class="sidebar-link">crud配置项</a></li><li><a href="/d2-crud-plus/guide/column-type.html" class="sidebar-link">字段类型</a></li><li><a href="/d2-crud-plus/guide/extends.html" class="sidebar-link">自定义扩展</a></li><li><a href="/d2-crud-plus/guide/slot.html" class="sidebar-link">slot自定义</a></li><li><a href="/d2-crud-plus/guide/dict.html" class="sidebar-link">数据字典</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>附加功能</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/permission.html" class="sidebar-link">权限管理</a></li><li><a href="/d2-crud-plus/guide/generate.html" class="sidebar-link">代码生成</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>字段类型文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/types.html" class="sidebar-link">字段类型列表</a></li><li><a href="/d2-crud-plus/guide/types-code.html" class="sidebar-link">字段类型默认配置参考</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>d2p-extends文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/extends/area-selector.html" class="sidebar-link">省市区选择组件</a></li><li><a href="/d2-crud-plus/guide/extends/avatar-cropper.html" class="sidebar-link">头像裁剪上传</a></li><li><a href="/d2-crud-plus/guide/extends/file-uploader.html" class="sidebar-link">文件上传组件</a></li><li><a href="/d2-crud-plus/guide/extends/icon-selector.html" class="sidebar-link">icon选择组件</a></li><li><a href="/d2-crud-plus/guide/extends/tree-selector.html" class="sidebar-link">树形选择组件</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>组件文档</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/components/cascade-format.html" class="sidebar-link">cascade-format</a></li><li><a href="/d2-crud-plus/guide/components/cascade-select.html" class="sidebar-link">cascade-select</a></li><li><a href="/d2-crud-plus/guide/components/d2p-cropper.html" class="sidebar-link">d2p-cropper</a></li><li><a href="/d2-crud-plus/guide/components/d2p-cropper-uploader.html" class="active sidebar-link">d2p-cropper-uploader</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/d2-crud-plus/guide/components/d2p-cropper-uploader.html#props" class="sidebar-link">Props</a></li><li class="sidebar-sub-header"><a href="/d2-crud-plus/guide/components/d2p-cropper-uploader.html#events" class="sidebar-link">Events</a></li></ul></li><li><a href="/d2-crud-plus/guide/components/d2p-file-uploader.html" class="sidebar-link">d2p-file-uploader</a></li><li><a href="/d2-crud-plus/guide/components/d2p-images-format.html" class="sidebar-link">d2p-images-format</a></li><li><a href="/d2-crud-plus/guide/components/d2p-tree-selector.html" class="sidebar-link">d2p-tree-selector</a></li><li><a href="/d2-crud-plus/guide/components/date-format.html" class="sidebar-link">date-format</a></li><li><a href="/d2-crud-plus/guide/components/dict-checkbox.html" class="sidebar-link">dict-checkbox</a></li><li><a href="/d2-crud-plus/guide/components/dict-radio.html" class="sidebar-link">dict-radio</a></li><li><a href="/d2-crud-plus/guide/components/dict-select.html" class="sidebar-link">dict-select</a></li><li><a href="/d2-crud-plus/guide/components/values-format.html" class="sidebar-link">values-format</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>其他帮助</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/d2-crud-plus/guide/log.html" class="sidebar-link">升级日志</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="d2p-cropper-uploader"><a href="#d2p-cropper-uploader" class="header-anchor">#</a> d2p-cropper-uploader</h1> <p>图片裁剪上传组件,封装了d2p-cropper, d2p-cropper内部封装了cropperjs</p> <h2 id="props"><a href="#props" class="header-anchor">#</a> Props</h2> <table><thead><tr><th>Name</th> <th>Description</th> <th>Type</th> <th>Required</th> <th>Default</th></tr></thead> <tbody><tr><td>value</td> <td>初始图片url</td> <td><code>String</code> /  <code>Array</code></td> <td><code>false</code></td> <td>-</td></tr> <tr><td>type</td> <td>上传后端类型，[cos,qiniu,alioss]</td> <td><code>String</code></td> <td><code>false</code></td> <td>cos</td></tr> <tr><td>uploadTip</td> <td>上传提示</td> <td><code>String</code></td> <td><code>false</code></td> <td>-</td></tr> <tr><td>title</td> <td>对话框标题</td> <td><code>String</code></td> <td><code>false</code></td> <td>-</td></tr> <tr><td>cropperHeight</td> <td>cropper的高度，默认为浏览器可视窗口高度的40%，最小270</td> <td><code>String</code> /  <code>Number</code></td> <td><code>false</code></td> <td>-</td></tr> <tr><td>dialogWidth</td> <td>对话框宽度，默认50%</td> <td><code>String</code> /  <code>Number</code></td> <td><code>false</code></td> <td>50%</td></tr> <tr><td>maxSize</td> <td>图片大小限制，单位MB</td> <td><code>Number</code></td> <td><code>false</code></td> <td>5</td></tr> <tr><td>limit</td> <td>图片数量限制</td> <td><code>Number</code></td> <td><code>false</code></td> <td>1</td></tr> <tr><td>accept</td> <td>可接收的文件后缀</td> <td><code>String</code></td> <td><code>false</code></td> <td>.jpg, .jpeg, .png, .gif, .webp</td></tr> <tr><td>cropper</td> <td>cropperjs的参数，详见：https://github.com/fengyuanchen/cropperjs</td> <td><code>Object</code></td> <td><code>false</code></td> <td>-</td></tr></tbody></table> <h2 id="events"><a href="#events" class="header-anchor">#</a> Events</h2> <table><thead><tr><th>Event Name</th> <th>Description</th> <th>Parameters</th></tr></thead> <tbody><tr><td>change</td> <td>-</td> <td>-</td></tr> <tr><td>input</td> <td>-</td> <td>-</td></tr></tbody></table></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/greper/d2-crud-plus/edit/master//docs/guide/components/d2p-cropper-uploader.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2020-4-7 16:49:44</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/d2-crud-plus/guide/components/d2p-cropper.html" class="prev">d2p-cropper</a></span> <span class="next"><a href="/d2-crud-plus/guide/components/d2p-file-uploader.html">d2p-file-uploader</a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/d2-crud-plus/assets/js/app.db3b8ec2.js" defer></script><script src="/d2-crud-plus/assets/js/2.38672536.js" defer></script><script src="/d2-crud-plus/assets/js/17.9457a8ba.js" defer></script>
  </body>
</html>
